package com.bluetrum.devicemanager.models;

public class DeviceCapacities {

    public static final int DEVICE_CAPACITY_SUPPORT_TWS             = (1 << 0);
    public static final int DEVICE_CAPACITY_SUPPORT_SOUND_EFFECT_3D = (1 << 1);
    public static final int DEVICE_CAPACITY_SPATIAL_AUDIO           = (1 << 1); // DEVICE_CAPACITY_SUPPORT_SOUND_EFFECT_3D
    public static final int DEVICE_CAPACITY_SUPPORT_MULTIPOINT      = (1 << 2);
    public static final int DEVICE_CAPACITY_SUPPORT_ANC             = (1 << 3);
    public static final int DEVICE_CAPACITY_SUPPORT_VOICE_RECOGNITION  = (1 << 4);
    public static final int DEVICE_CAPACITY_SUPPORT_BASS_ENGINE     = (1 << 5);
    public static final int DEVICE_CAPACITY_SUPPORT_ANTI_WIND_NOISE = (1 << 6); // TODO: 待定
    public static final int DEVICE_CAPACITY_SUPPORT_LE_AUDIO_BIS    = (1 << 6);

    private final int capacities;

    public DeviceCapacities(int capacities) {
        this.capacities = capacities;
    }

    public boolean supportTws() {
        return (capacities & DEVICE_CAPACITY_SUPPORT_TWS) != 0;
    }

    public boolean supportSoundEffect3d() {
        return (capacities & DEVICE_CAPACITY_SUPPORT_SOUND_EFFECT_3D) != 0;
    }

    public boolean supportSpatialAudio() {
        return (capacities & DEVICE_CAPACITY_SPATIAL_AUDIO) != 0;
    }

    public boolean supportMultipoint() {
        return (capacities & DEVICE_CAPACITY_SUPPORT_MULTIPOINT) != 0;
    }

    public boolean supportAnc() {
        return (capacities & DEVICE_CAPACITY_SUPPORT_ANC) != 0;
    }

    public boolean supportVoiceRecognition() {
        return (capacities & DEVICE_CAPACITY_SUPPORT_VOICE_RECOGNITION) != 0;
    }

    public boolean supportBassEngine() {
        return (capacities & DEVICE_CAPACITY_SUPPORT_BASS_ENGINE) != 0;
    }

    public boolean supportAntiWindNoise() {
        return (capacities & DEVICE_CAPACITY_SUPPORT_ANTI_WIND_NOISE) != 0;
    }

    public boolean supportLeAudioBis() {
        return (capacities & DEVICE_CAPACITY_SUPPORT_LE_AUDIO_BIS) != 0;
    }
}
